package com.gpay.erp.services.purchase;

import com.gpay.erp.core.Services;
import com.gpay.erp.services.purchase.bean.Application;
import com.gpay.erp.services.purchase.bean.ApplicationSub;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2015/10/22 0022.
 */
@Service
public interface ApplicationService extends Services<Application> {

    /**
     * 获取申请总数
     * @param application
     * @return
     */
    public int getCount(Application application);
    /**
     * 修改申请状态
     * @param
     * @return
     */
    public int updateApplicationById(Application application);

    /**
     * 生成申请代码
     * @return
     */
    public String getApplicationNumber();

    /**
     * 提交状态修改
     * @param id 主键id
     * @param status 提交状态 2
     * @return
     */
    public int updateCommitStatus(String id, String status);

    /**
     * 提交状态修改
     * @param application 主表
     * @param applicationSubList 字表
     * @return
     */
    public int saveUpdateApplicationSub(Application application, List<ApplicationSub> applicationSubList);

    /**
     *
     * @param id
     * @param status
     * @return
     */
    public Application getTotalValueAppliction(String id,String status);

    /**
     * 删除一行 保存信息
     * @param fid  删除的主表id
     * @param ids  删除的子表id
     * @return
     */
    public int deleteOneApplicationSub(String fid,List<String> ids);

    /**
     * 添加保存合同状态
     * @param application 主表
     * @param applicationSubList 字表
     * @return
     */
    public int saveApplicationSubList(Application application, List<ApplicationSub> applicationSubList);
}
